package com.cn.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.cn.pojo.UserInfo;

public interface UserDao {
	@Select("select id,loginName,userName,passWord,phone,email,sex,age,qq,address,gust from userinfo where loginName=#{loginName} and passWord=#{passWord}")
	UserInfo selectByLoginNameAndPassWord(@Param("loginName") String loginName,@Param("passWord") String passWord);
	@Select("select loginName from userinfo where loginName=#{loginName}")
	String selectByLoginName(@Param("loginName") String loginName);
	@Insert("insert into userinfo(loginName,userName,passWord,phone,email,sex,age,qq,address,gust) value(#{loginName},#{userName},#{passWord},#{phone},#{email},#{sex},#{age},#{qq},#{address},2)")
	boolean addUser(@Param("loginName")String loginName,@Param("userName")String userName,@Param("passWord")String passWord,@Param("phone")String phone,@Param("email")String email,@Param("sex")String sex,@Param("age")Integer age,@Param("qq")String qq,@Param("address")String address);
}
